package foo.bar.wiki.web.action.user;

import foo.bar.wiki.web.action.PaginatedBaseActionBean;
import foo.bar.wiki.web.action.ExtendedPaginatedList;
import foo.bar.wiki.services.UserService;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.integration.spring.SpringBean;

/**
 * @author tmjee
 * @version $Date$ $Id$
 */
public class ListUsersActionBean extends PaginatedBaseActionBean {

    public static final String VIEW = "/user/listUsers.jsp";


    private UserService userService;

    private ExtendedPaginatedList users;


    @DefaultHandler
    public Resolution view() {
        users = userService.getAllUsers(getPaginatedList("listUsers_paginatedList"));
        return new ForwardResolution(generateThemePath(VIEW));
    }
    

    @SpringBean("userService")
    public void setUserService(UserService userService) {
        this.userService = userService;    
    }


    public ExtendedPaginatedList getUsers() { return users; }


}
